#include <bits/stdc++.h>

#define in read()
#define fi first
#define se second
#define pb push_back

using namespace std;

using pii = pair < int , int >;
using vec = vector < int >;
using veg = vector < pii >;
using ll = long long;
using ull = unsigned long long;

ll read() {
    ll x = 0; bool f = 0; char ch = getchar(); while(!isdigit(ch)) f |= ch == '-',ch = getchar();
    while(isdigit(ch)) x = x * 10 + (ch ^ 48),ch = getchar(); return f ? -x : x;
}

const int N = 1e5 + 10;
const ull base = 19491001;

bool v[N];
int pri[N],pnum,n,ans;
ull pw[N];
ll a[N];

map < ull , int > cnt;
map < ull , bool > vis;
map < ull , ull > mat;

void shai(int l) {
	for(int i = 2;i <= l;i++) {
		if(!v[i]) pri[++pnum] = i;
		for(int j = 1;j <= pnum && pri[j] * i <= l;j++) {
			v[pri[j] * i] = true; if(i % pri[j] == 0) break;
		}
	}
}

void turn(ll x) {
	ull res = 1,ned = 1;
	for(int i = 1;i <= pnum && x > 1;i++)
		if(x % pri[i] == 0) {
			int ct = 0;
			while(x % pri[i] == 0) x /= pri[i],ct = (ct + 1) % 3;
			if(ct == 0) continue;
			if(ct == 1) res *= pri[i], ned *= pri[i] , ned *= pri[i];
			else res *= pri[i], res *= pri[i], ned *= pri[i];
		}
	if(x > 1) res *= x,ned *= x,ned *= x;
	cnt[res]++; mat[res] = ned;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("1.in","r",stdin);
#endif
	shai(2300);
    n = in; for(int i = 1;i <= n;i++) a[i] = in,turn(a[i]);
	ans += cnt[1] > 0;
	for(auto x : cnt) {
		if(x.fi != 1 && !vis[x.fi]) { ans += max(x.se,cnt[mat[x.fi]]), vis[mat[x.fi]] = vis[x.fi] = true; }
	}
	printf("%d\n",ans); return 0;
}
